// import { createRouter,createWebHashHistory } from "vue-router";
import { createRouter,createWebHistory } from "vue-router";

import DefaultPage          from "@/index/views/DefaultPage.vue"

import SingleFileB          from "@/index/views/start/SingleFileB.vue"

import ErrorPage            from "@/index/views/errorAndAssets/ErrorPage.vue"
import AssetsPage           from "@/index/views/errorAndAssets/AssetsPage.vue"
import AssetsBuildPage      from "@/index/views/errorAndAssets/AssetsBuildPage.vue"

import GlobalAndPart        from "@/index/views/style/GlobalAndPart.vue"
import DeepStyle            from "@/index/views/style/DeepStyle.vue"
import SassPage             from "@/index/views/style/SassPage.vue"

import BuildProjectPage     from "@/index/views/BuildProjectPage.vue"

import BaseAxios            from "@/index/views/ajax/BaseAxios.vue"
import InterceptorsAxios    from "@/index/views/ajax/InterceptorsAxios.vue"
import ModuleAxios          from "@/index/views/ajax/ModuleAxios.vue"
import ProxyAjax            from "@/index/views/ajax/ProxyAjax.vue"

import CompositionPage      from "@/index/views/composition/CompositionPage.vue"
import ComponentPage        from "@/index/views/composition/ComponentPage.vue"
import LifePage             from "@/index/views/composition/LifePage.vue"
import ThisPage             from "@/index/views/composition/ThisPage.vue"

import RouterPage           from "@/index/views/route/RouterPage.vue";

import PathPage           from "@/index/views/route/PathPage/PathPage.vue";
import ChildPathA           from "@/index/views/route/PathPage/pages/ChildPageA.vue";
import ChildPathB           from "@/index/views/route/PathPage/pages/ChildPageB.vue";

import ParentPage           from "@/index/views/route/ChildRoute/ParentPage.vue";
import ChildPageA           from "@/index/views/route/ChildRoute/pages/ChildPageA.vue";
import ChildPageB           from "@/index/views/route/ChildRoute/pages/ChildPageB.vue";

import ActiveRoute           from "@/index/views/route/ActiveRoute/ActiveRoute.vue";


import NotFound             from "@/index/views/NotFound.vue";

const router =  createRouter({
    // history:createWebHashHistory(),
    history:createWebHistory(process.env.BASE_URL),
    linkActiveClass:"active",
    linkExactActiveClass:"exact-active",
    routes:[
        // { path:"/",component:DefaultPage },
        { path:"/",redirect:"/default" },
        { path:"/default",component:DefaultPage,meta:{ a:1,isHide:true } },
        { path:"/single",component:SingleFileB,meta:{a:2} },
        { path:"/error",component:ErrorPage },
        { path:"/error/assets",component:AssetsPage },
        { path:"/error/build",component:AssetsBuildPage },
        { path:"/style/global",component:GlobalAndPart },
        { path:"/style/deep",component:DeepStyle },
        { path:"/style/sass",component:SassPage },
        { path:"/build",component:BuildProjectPage },
        { path:"/axios",component:BaseAxios },
        { path:"/axios/int",component:InterceptorsAxios },
        { path:"/axios/module",component:ModuleAxios },
        { path:"/axios/proxy",component:ProxyAjax },
        { path:"/composition",component:CompositionPage },
        { path:"/composition/comp",component:ComponentPage },
        { path:"/composition/lift",component:LifePage },
        { path:"/composition/this",component:ThisPage },

        { path:"/router",component:RouterPage },

        { path:"/router/path",component:PathPage,children:[
            // { path:"",component:ChildPathA },
            // { path:"",redirect:"/childA" },
            { path:"",redirect:"/router/path/childB" },
            { path:"/childA",component:ChildPathA },
            { path:"childB",component:ChildPathB },
            { path:"/:aa(.*)*",component:NotFound },
        ] },

        { path:"/router/parent",component:ParentPage,children:[
            { path:"/router/parent/childA",component:ChildPageA },
            { path:"/router/parent/childB",component:ChildPageB },
        ] },
        { path:"/router/active",component:ActiveRoute },

        { path:"/:aa(.*)*",component:NotFound },
    ]
})

export default router;